﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BannerTopo.aspx.cs" Inherits="Amoo.Banner.BannerTopo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body bgcolor="#ccffcc">
    <form id="form1" runat="server">

        <div style="position:absolute;left:30px; top:0px; width: 100%;">
        
            <div id="dvBannerFederal" class="widthBanner" runat="server" style="position:absolute; top:10px; left:2%"></div>
            <div id="dvBannerEstadual" class="widthBanner" runat="server" style="position:absolute; top:10px; left:22%"></div>
            <div id="dvBannerMunicipal1" class="widthBanner" runat="server" style="position:absolute; top:10px; left:42%"></div>
            <div id="dvBannerMunicipal2" class="widthBanner" runat="server" style="position:absolute; top:10px; left:62%"></div>
            <div id="dvBannerMunicipal3" class="widthBanner" runat="server" style="position:absolute; top:10px; left:82%"></div>    
        
        </div>

    </form>
</body>

<script language=javascript>

    function changeBannerMunicipal()
    {
        changeBanner("dvBannerMunicipal1");
        changeBanner("dvBannerMunicipal2");
        changeBanner("dvBannerMunicipal3");
    } 
    
    function changeBannerEstadual()
    {
        changeBanner("dvBannerEstadual");
    }    	    
    
    function changeBannerFederal()
    {
        changeBanner("dvBannerFederal");
    }

    function changeBanner(strIdBanner)
    {
       
        for (i=0; i < eval(strIdBanner).getElementsByTagName("div").length; i++)
        {

            if (eval(strIdBanner).getElementsByTagName("div").item(i).style.display == "")
            {
                eval(strIdBanner).getElementsByTagName("div").item(i).style.display = "none";
                
                if (i == eval(strIdBanner).getElementsByTagName("div").length - 1)
                {
                    eval(strIdBanner).getElementsByTagName("div").item(0).style.display = "";
                }
                else
                {

                    eval(strIdBanner).getElementsByTagName("div").item(i+1).style.display = "";
                }
                
                return "";
            }

        }
        
    }

    changeBannerFederal();
    changeBannerEstadual();
    changeBannerMunicipal();

    window.setInterval(changeBannerFederal, 10000);
    window.setInterval(changeBannerEstadual, 10000);
    window.setInterval(changeBannerMunicipal, 10000);
    
</script>

</html>
